﻿using System;
using System.Windows;
using System.Windows.Data;
using System.Globalization;

namespace Colorful.Control.Converters
{
    public class IntRangeToVisibilityConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            int intValue = System.Convert.ToInt32(value);
            int intMinForVisibility = System.Convert.ToInt32(parameter);

            if (intValue >= intMinForVisibility)
                return Visibility.Visible;
            else
                return Visibility.Collapsed;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
